package bookez.model.dao.hibernate;

import java.util.List;

import org.hibernate.Query;

import bookez.model.businessobject.TripDailyRecord;
import bookez.model.dao.TripDailyRecordDao;
import bookez.model.dao.generic.GenericDaoHibernateImpl;
import bookez.model.exception.DataAccessLayerException;

public class TripDailyRecordDaoHibernateImpl extends GenericDaoHibernateImpl<TripDailyRecord, Long> 
implements TripDailyRecordDao {

	public TripDailyRecordDaoHibernateImpl(Class<TripDailyRecord> type) {
		super(type);
		// TODO Auto-generated constructor stub
	}//end constructor

	@SuppressWarnings("unchecked")
	@Override
	public List<TripDailyRecord> findAll() throws DataAccessLayerException {
		// TODO Auto-generated method stub
		List<TripDailyRecord> result = null;
		
		try {
			Query query = getSession().createQuery( TripDailyRecord.NamedQueries.FIND_ALL );
			result = query.list();
			return result;
		}//end try
		
		catch ( Exception ex ) {
			throw new DataAccessLayerException( ex );
		}//end catch
	}//end method findAll	

}//end class TripDailyRecordDaoHibernateImpl